<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<title>个人中心</title>
		<link rel="stylesheet" href="<?php echo base_url(),FRONT_DIR?>css/amazeui.min.css" />
		

		<link rel="stylesheet"  href="<?php echo base_url(),FRONT_DIR?>css/demo.css" />
		<link rel="stylesheet" href="<?php echo base_url(),FRONT_DIR?>member/css/style.css">
	</head>
	<body>
		
		<!--顶部导航条 -->
		<?php $this->load->view('public/top-nav.html');?>
		
		<div class="container w1200 padding-top-20">
			<?php $this->load->view('member/member-leftmenu.html');?>
			<div class="member-right">
				<h4 class="title">
					<a href="<?php echo base_url();?>user/center"><span <?php if($status==NULL):?> class="current" <?php endif;?>>全部</span></a>
					<a href="<?php echo base_url();?>user/center?status=1"><span <?php if($status=="1"):?> class="current" <?php endif;?>>已完成</span></a>
					<a href="<?php echo base_url();?>user/center?status=0"><span<?php if($status=="0"):?> class="current" <?php endif;?>>未完成</span></a>
				</h4>
					<table class="table" style=" ">
					<thead>
						<tr>
							<th>订单编号</th>
							<th>产品</th>
							<th>日期</th>
							<th>金额</th>
							<th>支付状态</th>
						</tr>
					</thead>
					<tbody>
						<?php foreach($orders as $k=>$v):?>
						<tr>
							<td><?php echo $v['trade_no'];?></td>
							<td title="<?php echo $v['goods_names'];?>">
								<?php if(mb_strlen($v['goods_names']) >12):?><?php echo mb_substr($v['goods_names'],0,12),'......';?><?php else:?><?php echo $v['goods_names'];?><?php endif;?>
							</td>
							<td><?php echo date("Y-m-d H:i:s",$v['ctime']);?></td>
							<td><?php echo $v['total'];?></td>
							<td>
								<?php if($v['pay_status']==0):?>
									未支付
								<?php else:?>
									支付成功
								<?php endif;?>
							</td>
						</tr>
						<?php endforeach;?>
						
					</tbody>
				</table>
				<div class="clear"></div>
				<!--分页 -->

				<ul class="am-pagination am-pagination-right">
						<?php echo $page;?>
				</ul>



			</div>
		</div>
		<script src="<?php echo base_url(),FRONT_DIR?>js/jquery-1.7.min.js"></script>
		
		<script type="text/javascript">
			$(function(){
				
				/*$.ajax({
	              url: "<?php echo base_url(),'user/center_ajax';?>",
	              type: "get",
	              dataType: "html",
	              'data':{
	                    status:-1
						
	                },
	            beforeSend : function (jqXHR, settings) {
	                      $('#center-ajax').append('<p><img src="<?php echo base_url(),FRONT_DIR?>images/loading.gif" style="width:28px;"  width="28" alt="数据交互中"></p>');
	                },
	              success: function(response, status, xhr){
	                $('#center-ajax').html(response);
	              
	              }
        		});

				$("h4.title span").click(function(){
					$(this).addClass('current').siblings("h4.title span").removeClass('current');
					$.ajax({
		              url: "<?php echo base_url(),'user/center_ajax';?>",
		              type: "get",
		              dataType: "html",
		              'data':{
		                    status:$(this).attr('data-pay-status')
		                },
		            beforeSend : function (jqXHR, settings) {
		                      $('#center-ajax').append('<p><img src="<?php echo base_url(),FRONT_DIR?>images/loading.gif" style="width:28px;"  width="28" alt="数据交互中"></p>');
		                },
		              success: function(response, status, xhr){
		                $('#center-ajax').html(response);
		              
		              }
	    		});
				})

				//分页
				$('ul.am-pagination li a').live('click',function(){
		         var url = $(this).attr('ajaxhref');
					$.ajax({
		              url: url,
		              type: "get",
		              dataType: "html",
		              'data':{
		                    //status:$(this).attr('data-pay-status')
		                },
		            beforeSend : function (jqXHR, settings) {
		                      $('#center-ajax').append('<p><img src="<?php echo base_url(),FRONT_DIR?>images/loading.gif" style="width:28px;"  width="28" alt="数据交互中"></p>');
		                },
		              success: function(response, status, xhr){
		                $('#center-ajax').html(response);
		                
		              }
		        });
				
				});*/


			});
		</script>
	</body>
</html>


